package com.kexio;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * Kexio应用启动类
 * 
 * 集成所有业务模块和框架模块的统一启动入口
 * 
 * @author Kexio Team
 * @since 1.0.0
 */
@SpringBootApplication(scanBasePackages = {
    "com.kexio.common",      // 通用工具
    "com.kexio.core",        // 核心框架
    "com.kexio.dynamic",     // 动态功能
    "com.kexio.enterprise",  // 企业功能
    "com.kexio.security"     // 安全模块（用户、认证、角色、权限）
})
@EnableCaching
@EnableTransactionManagement
public class KexioApplication {

    public static void main(String[] args) {
        // 设置系统属性
        System.setProperty("spring.application.name", "kexio-application");
        
        // 启动应用
        SpringApplication application = new SpringApplication(KexioApplication.class);
        
        // 自定义启动配置
        application.setAdditionalProfiles("dev"); // 默认使用dev profile
        
        // 运行应用
        application.run(args);
        
        System.out.println("\n" +
            "=======================================================\n" +
            "    🎉 Kexio System 启动成功！\n" +
            "    📚 API文档: http://localhost:8080/doc.html\n" +
            "    🔧 健康检查: http://localhost:8080/actuator/health\n" +
            "    💡 Spring Boot版本: 3.1.5\n" +
            "    🚀 架构: 3-Starter简化版 + Dynamic功能\n" +
            "=======================================================\n"
        );
    }
}
